[Groovy] Class FarmedCereal

java.lang.Object
  fhg2a.relogo.Food
      FarmedCereal

class FarmedCereal
extends Food

Farmed cereal is a food resource maintained by handling (cultivation by a tribe) rather than automatic growth. Growth is based on tribe activity and wild cereal population. Handling and net acquisition rate are calculated based on the time taken to produce the cereal rather than a 'search' time, as is the case with the basic Food type.


Property Summary
java.lang.Object NAR

java.lang.Object capacity

java.lang.Object farmCost

java.lang.Object grow

Hide grow method.

java.lang.Object isFarmed

java.lang.Object totalTimePerUnit

 
Method Summary
java.lang.Object deactivate()

Deactivate farming.

java.lang.Object handle(java.lang.Object energyRequired, java.lang.Object populationSize)

Cultivate farmed cereal and returns net energy obtained by tribe in 365 14-hour days.

java.lang.Object init(java.lang.Object carryingCapacity)

Set the upper limit (number of units) for this resource based on the carrying capacity, and initialise this resource as unfarmed.

java.lang.Object netAcquisitionRate()

Get the net acquisition rate for this resource.

java.lang.Object setFarm(java.lang.Object isFarming)

Set this resource to a farmed or unfarmed state.

 

Property Detail

NAR

java.lang.Object NAR


capacity

java.lang.Object capacity


farmCost

java.lang.Object farmCost


grow

abstract java.lang.Object grow
Hide grow method. Farmed cereal does not grow, it must be cultivated by calling handle().


isFarmed

java.lang.Object isFarmed


totalTimePerUnit

java.lang.Object totalTimePerUnit


 
Method Detail

deactivate

java.lang.Object deactivate()
Deactivate farming. Used to reset farming every epoch. Farming will only be reactivated if a tribe chooses to farm here.


handle

java.lang.Object handle(java.lang.Object energyRequired, java.lang.Object populationSize)
Cultivate farmed cereal and returns net energy obtained by tribe in 365 14-hour days. Tribe will never gather more than it needs or more than is available.
Parameters:
energyRequired - Maximum energy required by handling attempt.
populationSize - The number of individuals available to handle food (ignored in farmed cereal handling).
Returns:
Energy obtained from farmed cereal in one year


init

java.lang.Object init(java.lang.Object carryingCapacity)
Set the upper limit (number of units) for this resource based on the carrying capacity, and initialise this resource as unfarmed.
Parameters:
carryingCapacity - Maximum density in units per sq km


netAcquisitionRate

java.lang.Object netAcquisitionRate()
Get the net acquisition rate for this resource.
Returns:
Net acquisition rate for this resource.


setFarm

java.lang.Object setFarm(java.lang.Object isFarming)
Set this resource to a farmed or unfarmed state.
Parameters:
isFarming - Flag to indicate if farming is occurring.